/*
  学习目标：使用Prop.children属性-
   1. props.children指：组件标签夹着的内容
   2. 通过props.children获取
 
*/
import React, { Component } from 'react';

export default class App extends Component {
  render() {
    return (
      <div>
        <Hello>{(msg) => <i>{msg}</i>}</Hello>
      </div>
    );
  }
}

class Hello extends React.Component {
  state = {
    msg: 'Hello React',
  };

  render() {
    return <h1>{this.props.children(this.state.msg)}</h1>;
  }
}
